

<?php 
	$data['web_service'] = $this->main_model->get_web_service();

?>

<div style="background-color:#006699; height:46px; width:100%; position:fixed; z-index:10000;">
  <button type="button" class="btn btn-default btn-lg" id="menu-toggle" style="padding:5px; width:60px; height:46px;"> 
  <!-- <span class="glyphicon glyphicon-align-justify"></span>&nbsp; -->
   <?php if(@$data['web_service'][0]['web_logo'] != '' ) { ?>
   <img src="<?php echo base_url();?>img/<?php echo $data['web_service'][0]['web_logo'];?>" height="34px" />
   <?php } else { ?>   
   <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
   <?php } ?>
  </button>
  
 
    <font color="#ffffff" size="+1">
      <!-- <span class="glyphicon glyphicon-facetime-video"></span> -->
      &nbsp;<a class="b" href="<?php echo base_url();?>"><?php echo @$data['web_service'][0]['web_name'];?></a>
 	</font> 
	
<?php 
	date_default_timezone_set("Asia/Bangkok");
	$now = date("Y-m-d H:i");
		
	$all_session = $this->session->all_userdata();
	$exp_id = $all_session['login'][0]['mem_id'];
				
	$this->db->select('grant_start ,grant_end');
	$this->db->from('member');
	$this->db->where('mem_id',$exp_id);
	$query = $this->db->get();
	$exp_date = $query->result_array();

	$exp = (strtotime($exp_date[0]['grant_end']) - strtotime($now))/  ( 60 * 60 );
?>
  
<div style="float:right; padding:0.25em 2em 0 0">
 <font color="#ffffff" >
 



		<div style="float:right;">	
            <?php if(@$exp > 0) { ?>
                
                <?php
					$strDate = date_parse($exp_date[0]['grant_end']);
				?>
                 <table>
                <tr>
                    <td align="center">
                    <font size="2" color="orange">
                        <?php echo $strDate["hour"].":".$strDate["minute"].":".$strDate["second"]; ?>
                    </font>
                    </td>
                </tr>
                
                <tr>
                    <td align="center">
                    <font size="-2" color="orange">
                    	<?php echo $strDate["year"]."-".$strDate["month"]."-".$strDate["day"]; ?>
                    </font>
                    </td>
                    
                 </tr>
             
             </table>
            <?php } else { ?>        
             <table>
                <tr>
                    <td align="center">
                    <font size="2">
                        <div id="txt"></div>
                    </font>
                    </td>
                </tr>
                
                <tr>
                    <td align="center">
                    <font size="-2">
                        <div id="txt_2"></div>
                    </font>
                    </td>
                    
                 </tr>
             
             </table>
            <?php } ?>
       </div>
            
</font>
</div>
  
  
</div>
